#include "Shm.hpp"
#include "Fifo.hpp"
#include <iostream>
int main()
{
    Shm shm(pathname, projid, CREATER);
    sleep(5);
    shm.Attr();

    NamedFifo fifo(PATH, FILENAME);

    FileOper readerfile(PATH, FILENAME);
    readerfile.OpenForRead();

    char *mem = (char *)shm.VirtualAddr();

    while (1)
    {
        if (readerfile.Wait())
        {
            printf("%s\n", mem);
        }
        else
        {
            break;
        }
    }

    readerfile.Close();

    std::cout<<"server end normal!"<<std::endl;
    return 0;
}